package com.ws.test;

public class TableFormatter {
    public static void main(String[] args) {

        // 第一部分：公司信息
        System.out.printf("%-10s %-10s %-15s %-20s\n", "公司序号", "公司名称", "公司单车数量", "公司单车借出次数");
        System.out.printf("+%-10s+%-10s+%-15s+%-20s+\n", "-".repeat(10), "-".repeat(10), "-".repeat(15), "-".repeat(20));
        System.out.printf("%-10d %-10s %-15d %-20d\n", 1, "ofo单车", 3, 100);
        System.out.printf("+%-10s+%-10s+%-15s+%-20s+\n", "-".repeat(10), "-".repeat(10), "-".repeat(15), "-".repeat(20));

        // 第二部分：单车信息
        System.out.printf("%-15s %-10s %-10s %-10s\n", "单车序号", "单车品牌", "单车状态", "借出时间");
        System.out.printf("+%-15s+%-10s+%-10s+%-10s+\n", "-".repeat(15), "-".repeat(10), "-".repeat(10), "-".repeat(10));
        System.out.println("|ofo单车0 |可借 |");
        System.out.println("|ofo单车1 |可借 |");
        System.out.println("|ofo单车2 |可借 |");

        // 第三部分：公司信息
        System.out.printf("+%-10s+%-10s+%-15s+%-20s+\n", "-".repeat(10), "-".repeat(10), "-".repeat(15), "-".repeat(20));
        System.out.printf("%-10d %-10s %-15d %-20d\n", 2, "halo单车", 3, 210);
        System.out.printf("+%-10s+%-10s+%-15s+%-20s+\n", "-".repeat(10), "-".repeat(10), "-".repeat(15), "-".repeat(20));

        // 第四部分：单车信息
        System.out.printf("%-15s %-10s %-10s %-10s\n", "单车序号", "单车品牌", "单车状态", "借出时间");
        System.out.printf("+%-15s+%-10s+%-10s+%-10s+\n", "-".repeat(15), "-".repeat(10), "-".repeat(10), "-".repeat(10));
        System.out.println("|halo单车0 |可借 |");
        System.out.println("|halo单车1 |可借 |");
        System.out.println("|halo单车2 |可借 |");
    }
}